home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / X11 / Xsession.d / 90consolekit < prev    next >
Encoding:
Text File  |  2010-02-24  |  1.0 KB  |  33 lines

  1. # -*- sh -*-
  2. # Xsession.d script for ck-launch-session.
  3. #
  4. #
  5. # This file is sourced by Xsession(5), not executed.
  6.  
  7. CK_LAUNCH_SESSION=/usr/bin/ck-launch-session
  8.  
  9. is_on_console() {
  10.     session=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
  11.         --type=method_call --print-reply --reply-timeout=2000 \
  12.         /org/freedesktop/ConsoleKit/Manager \
  13.         org.freedesktop.ConsoleKit.Manager.GetCurrentSession \
  14.         | grep path | awk '{print $3}' | sed s/\"//g)
  15.     x11_display=$(dbus-send --system --dest=org.freedesktop.ConsoleKit \
  16.         --type=method_call --print-reply --reply-timeout=2000 \
  17.         $session org.freedesktop.ConsoleKit.Session.GetX11Display \
  18.         | grep string | awk '{print $2}' | sed s/\"//g)
  19.  
  20.     if [ -z "$x11_display" ] ; then
  21.         return 0
  22.     else
  23.         return 1
  24.     fi
  25. }
  26.  
  27. # gdm already creates a CK session for us, so do not run the expensive D-Bus
  28. # calls if we have $GDMSESSION
  29. if [ -z "$GDMSESSION" ] && [ -x "$CK_LAUNCH_SESSION" ] && \
  30.  ( [ -z "$XDG_SESSION_COOKIE" ] || is_on_console ) ; then
  31.     STARTUP="$CK_LAUNCH_SESSION $STARTUP"
  32. fi
  33.